package cn.kgc.jdktest.demo7;

/**
 * @Author:yaozhaobao
 * @Description:TODO
 * @version:1.0
 */
public class Test {

    public static void main(String[] args) {
        involeCal(new Calculator() {
            @Override
            public int cal(int a, int b) {
                return a+b;
            }
        },5,10);

        involeCal((a,b)->{
            return a-b;
        },10,5);

        involeCal((a,b)->a-b,10,5);
    }


    public static void involeCal(Calculator calculator,int a, int b){
        int cal = calculator.cal(a, b);
        System.out.println("计算结果："+cal);
    }
}
